######################################################## 
## Mod Title:   Last Visit Member list Mod (PART 2) 
## Mod Version: 1.0.7 
## Author:      Niels Chr. Rd Denmark < ncr@db9.dk > 
## Tested by:   totoelectro 
## 
## Description:  This mod will enable users to see other users 
## last visit, the information is stored already, but other users can not see 
## it, after this mod, users can see when another user have last visited 
## the board, this is shown in the memberlist. 
## This feture support, user level and hidden users 
## Admin will always be able to se all users last visit, regardless of the settings 
## if board config is "off", then only admin can see the information 
## if board is "on", then all users kan se other users last visit 
## ecxept hidden users, who always will be "hidden" 
## only admin can sort by "last visit" since 
## 
## 
## This mod is only for phpBB2!! 
##  developed in RC-2 
##  modifyed/confirmed to RC-4 
## 
## 
## Installation Level:  very Easy 
## Installation Time:   2-4 Minutes 
## Files To Edit:      2 
##   phpBB2/memberlist.php 
##   phpBB2/templates/template_dirXX/member_body.tpl    

######################################################## 
## 
## Installation Notes: 
## 
## This mod Asumes that "Last Visit PART 1" mod have already be made ! 
## 
## The most important thing to keep in mind is, take your time, make 
## sure you are finding the correct lines to modify, then take care to paste the new code. 
## Please also keep in mind, if you are using more than one theme at your 
## site, you will need to edit the correct files for each occurrence.  Good Luck! 
######################################################## 


# 
#-----[ ACTION ]------------------------------------------ 
# 
## OPEN FILE:  phpBB2/memberlist.php 

[FIND]: 
$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page']; 
break; 

[ADD AFTER]: 

case 'lastlogon': 
   $order_by = ($userdata['user_level'] == ADMIN ) ? "user_lastlogon $sort_order LIMIT $start, " . $board_config['topics_per_page'] : "username $sort_order LIMIT $start, " . $board_config['topics_per_page']; 
   break; 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar 

[REPLACE WITH]: 
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_lastlogon, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_allow_viewonline 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 

$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'],  $lang['Sort_Website'], $lang['Sort_Top_Ten']); 

[REPLACE WITH]: 

$mode_types_text = array($lang['Last_logon'], $lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'],  $lang['Sort_Website'], $lang['Sort_Top_Ten']); 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 

$mode_types = array("joindate", "username", "location", "posts", "email", "website", "topten"); 

[REPLACE WITH]: 

$mode_types = array("lastlogon", "joindate", "username", "location", "posts", "email", "website", "topten"); 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 

for($i = 0; $i < count($mode_types_text); $i++) 

[REPLACE WITH]: 

for($i = ($userdata['user_level'] == ADMIN ) ? 0:1; $i < count($mode_types_text); $i++) 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 
"L_ICQ" => $lang['ICQ'], 

[ADD AFTER]: 

"L_LOGON" => $lang['Last_logon'], 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 

"JOINED" => $joined, 

[ADD AFTER]: 

"LAST_LOGON" => ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $members[$i]['user_allow_viewonline'])) ? (($members[$i]['user_lastlogon'])? create_date($userdata['user_dateformat'], $members[$i]['user_lastlogon'], $userdata['user_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'], 


################################### This completes the changes in memberlist.php ############################## 


# 
#-----[ ACTION ]------------------------------------------ 
# 
#OPEN FILE:  phpBB2/templates/template_dirXX/memberlist_body.tpl (make sure to edit this file for every theme you use). 

[FIND]: 
<th class="thTop" nowrap="nowrap">{L_JOINED}</th> 

[ADD AFTER]: 
<th class="thTop" nowrap="nowrap">{L_LOGON}</th> 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 

<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.JOINED}</span></td> 

[ADD AFTER] 

<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.LAST_LOGON}</span></td> 
      
# 
#-----[ ACTION ]------------------------------------------ 
# 

[FIND]: 

<td class="catbottom" colspan="8" height="28">&nbsp;</td> 

[REPLACE WITH]: 

<td class="catbottom" colspan="9" height="28">&nbsp;</td> 

################################### This completes the changes in memberlist_body.tpl ############################## 


THAT'S IT!!  You're all done. 

// EOF 